
package attr

var nameToIdx map[string]int64
var idxToName map[int64]string

const(
	Level = 0 //等级
	CurrentExp = 1 //当前经验值
	UpperExp = 2 //当前等级经验上限
	TotalExp = 3 //总经验值
	ActionPoint = 4 //体力值
	Gold = 5 //星币
	Diamond = 6 //钻石
	StoryStage = 7 //剧情阶段
	YHBattleGroundEnterTimes = 8 //英魂战场免费进入次数
	SkillPoint = 9 //技能点数
	AttrMax = 10
)

func init() {	
	nameToIdx = map[string]int64{}
	idxToName = map[int64]string{}
	nameToIdx["Level"] = 0
	idxToName[0] = "Level"
	nameToIdx["CurrentExp"] = 1
	idxToName[1] = "CurrentExp"
	nameToIdx["UpperExp"] = 2
	idxToName[2] = "UpperExp"
	nameToIdx["TotalExp"] = 3
	idxToName[3] = "TotalExp"
	nameToIdx["ActionPoint"] = 4
	idxToName[4] = "ActionPoint"
	nameToIdx["Gold"] = 5
	idxToName[5] = "Gold"
	nameToIdx["Diamond"] = 6
	idxToName[6] = "Diamond"
	nameToIdx["StoryStage"] = 7
	idxToName[7] = "StoryStage"
	nameToIdx["YHBattleGroundEnterTimes"] = 8
	idxToName[8] = "YHBattleGroundEnterTimes"
	nameToIdx["SkillPoint"] = 9
	idxToName[9] = "SkillPoint"
}

func GetIdByName(name string) int64 {
	return nameToIdx[name]
}

func GetNameById(id int64) string {
	return idxToName[id]
}
